package org.zjx.common.service.impl;

import org.zjx.common.bean.Screen;
import org.zjx.common.db.ScreenDB;
import org.zjx.common.service.ScreenService;

import java.awt.*;

public class ScreenServiceImpl implements ScreenService {
    @Override
    public Boolean isRoom(String screenName) {
        Screen screen = new ScreenDB().findByName(screenName);
        return screen != null && screen.getFatherId() != 0;
    }

    @Override
    public Point getScreenSize(String screenName) {
        Screen screen = new ScreenDB().findByName(screenName);
        if (screen == null) return new Point(0, 0);
        return new Point(screen.getWidth(), screen.getHeight());
    }
}
